import { Component, OnInit } from '@angular/core';
import {Service} from '../service/service';
import {Config} from '../service/config';

@Component({
  selector: 'app-product',
  templateUrl: './product.component.html',
  styleUrls: ['./product.component.scss']
})
export class ProductComponent implements OnInit {

  constructor(private service: Service) {
    this.getAllUser();
  }
  listOfData = [

  ];
  getAllUser() {
    this.service.getAllProduct(null, (result) => {
      console.log(result);
      result.data.forEach(item => {
        item.getcover.path = Config.API_URL + 'uploads/images/' + item.getcover.path;
      })
      this.listOfData = result.data;
      console.log(this.listOfData);
    });
  }
  ngOnInit(): void {
  }

}
